const path = require('path')
const common = require('./webpack.common.js');
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { merge } = require('webpack-merge')
module.exports = merge(common, {
  mode: "production",
  devtool: "nosources-source-map",
  output: {
    filename: 'bundle-[chunkhash].js',
  },
  optimization: {
    concatenateModules: true,// 开启代码合并
  },
  plugins: [
    new CopyWebpackPlugin({
      patterns: [{
        from: path.join(__dirname, 'public'),
        globOptions: {
          ignore: [
            // Ignore all `html` files
            "**/*.html",
          ],
        },
      }]
    }),// 复制公共文件
  ]
})

